<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /* Student name,age
        skill ="webgis"
         */
        class Student {
            /* 实例属性 */
            skill = "webgis"
            constructor(name, age) {
                this.name = name;
                this.age = age;

            }
            /* 方法是原型属性 */
            sayName() {
                console.log("name")
            }
        }
        var zhang = new Student("张三", 18);
        console.log(zhang)
        zhang.skill = "数据处理";
        console.log(zhang)
        console.log(zhang.hasOwnProperty("skill")) 
        console.log(zhang.hasOwnProperty("name"))
        console.log(zhang.hasOwnProperty("age"))
        console.log(zhang.hasOwnProperty("constructor"))
        console.log(zhang.hasOwnProperty("sayName"))
    </script>
</body>

</html>